package com.cloud.screen.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cloud.api.domain.screen.VehicleStatisticsData;
import com.cloud.api.domain.tsp.VehicleMessageDaily;
import com.cloud.screen.config.MysqlConfig;
import com.cloud.screen.mapper.VehicleMessageDailyMapper;
import com.cloud.screen.service.IVehicleMessageDailyService;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * @author 杨斌
 * 2024-03-14/3/2024
 */
@Service("vehicleMessageDailyService")
@DS("doris")
public class VehicleMessageDailyServiceImpl extends ServiceImpl<VehicleMessageDailyMapper, VehicleMessageDaily> implements IVehicleMessageDailyService {
    @Resource
    private VehicleMessageDailyMapper vehicleMessageDailyMapper;

    @Autowired
    private MysqlConfig mysqlConfig;


    @Override
    public List<VehicleStatisticsData> getVehicleStatistics() {
        return vehicleMessageDailyMapper.getVehicleStatistics(mysqlConfig.getDataSource(),mysqlConfig.getSecond());
    }

}
